import Item from '../Item';
import { FC } from 'react';
import { useSelector } from 'react-redux';
import './index.css';
import { RootState } from '../../app/store';
const List: FC = () => {
  const state = useSelector((state: RootState) => state.todoList);
  return (
    <ul className="list">
      {state.map((todo) => (
        <Item id={todo.id} name={todo.name} done={todo.done} key={todo.id} />
      ))}
    </ul>
  );
};
export default List;
